<page-header [title]="'当前用户 【'+entity.name+'】'"></page-header>
<nz-card>
  <nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
  <nz-tabset [nzSelectedIndex]="index">
    <nz-tab nzTitle="用户信息">
      <div *ngIf="!isLoading">
        <h2> 基础信息 </h2>
        <desc-list [col]="4">
          <desc-list-item term="微信昵称">{{ entity.name }}</desc-list-item>
          <desc-list-item term="用户角色">{{entity.role|dicsNamePipe:userRoleOption}}</desc-list-item>
          <desc-list-item term="用户手机">{{ entity.phone }}<span *ngIf="!entity.phone">未绑定</span></desc-list-item>
          <desc-list-item term="用户邮箱">{{ entity.email }}<span *ngIf="!entity.email">未绑定</span></desc-list-item>
          <desc-list-item term="TAK总积分">{{ entity.totalTakCredit }}</desc-list-item>
          <desc-list-item term="TAK剩余积分">{{ entity.residualTakCredit }}</desc-list-item>
          <desc-list-item term="总积分">{{ entity.totalCredit }}</desc-list-item>
          <desc-list-item term="剩余积分">{{ entity.residualCredit }}</desc-list-item>
        </desc-list>
        <h2> 用户地址 </h2>
        <nz-table #cusAddressTab [nzData]="cusAddress" [nzShowPagination]="false">
          <thead>
          <tr>
            <th>收货人姓名</th>
            <th>收货人手机号</th>
            <th>地址</th>
            <th>是否默认</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let data of cusAddressTab.data">
            <td >{{data.postalName|stringEllipsisCutPipe:8}}</td>
            <td>{{data.postalPhone}}</td>
            <td>{{data.province}}{{data.city}}{{data.county}}{{data.address|stringEllipsisCutPipe:10}}</td>
            <td>{{data.beDefault|yesNoPipe}}</td>
          </tr>
          </tbody>
        </nz-table>
      </div>
    </nz-tab>
    <nz-tab nzTitle="关联店铺">
      <app-otc-cus-shop *ngIf="!isLoading" [customerId]="id"></app-otc-cus-shop>
    </nz-tab>
    <nz-tab nzTitle="积分明细">
      <app-otc-credit-record *ngIf="!isLoading" [customerId]="id"></app-otc-credit-record>
    </nz-tab>
  </nz-tabset>
</nz-card>
